<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page session="false" %>
<%@ page isELIgnored ="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<html>
	<head>
	    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	    <title></title>
	    <style type="text/css">
	        @import "${pageContext.request.contextPath}/assets/dojo/dojo/resources/dojo.css";
	        @import "${pageContext.request.contextPath}/assets/dojo/dijit/themes/claro/claro.css";
			@import "${pageContext.request.contextPath}/assets/dojo/dojox/grid/resources/nihiloGrid.css";
			@import "${pageContext.request.contextPath}/assets/dojo/dojox/form/resources/CheckedMultiSelect.css";
			@import "${pageContext.request.contextPath}/assets/dojo/dojox/grid/enhanced/resources/EnhancedGrid_rtl.css";
			@import "${pageContext.request.contextPath}/assets/dojo/dijit/themes/claro/claro.css";
			@import "${pageContext.request.contextPath}/assets/dojo/dojox/grid/enhanced/resources/claro/EnhancedGrid.css";
			@import "${pageContext.request.contextPath}/assets/style/module.css";
			@import "${pageContext.request.contextPath}/assets/style/kijit.css";
			@import "${pageContext.request.contextPath}/assets/style/icon_s_admin.css";
			@import "${pageContext.request.contextPath}/assets/kanas/resources/commonIcons16.css";
	    </style>
		<script src="${pageContext.request.contextPath}/assets/appscript/dojoconfigbaseurl.js" type="text/javascript"></script>
		<script src="${pageContext.request.contextPath}/assets/appscript/dojoconfig.js" type="text/javascript"></script>
	    <script type="text/javascript" src="${pageContext.request.contextPath}/assets/dojo/dojo/dojo.js" data-dojo-config="parseOnLoad: true,async:true,locale:'zh',isDebug: false"></script>
	    <script type="text/javascript" src="${pageContext.request.contextPath}/assets/kanas/kanas-base.js"></script>
	</head>
	<body class="claro" >
			<script type="text/javascript">
				require(["dojo/ready","dojo/parser","dojo/i18n!appscript/locale/nls/SysAdmin","${pageContext.request.contextPath}/assets/appscript/Module.js", "dojo/store/Memory", "dojo/query!css2",
				         "dijit/Menu", "dijit/MenuItem", "dijit/tree/ObjectStoreModel", "dijit/Tree",
							"dojo/_base/kernel","dojo/_base/loader",
							"dijit/layout/BorderContainer","dijit/layout/ContentPane","dijit/layout/TabContainer",
			    			"dijit/Toolbar","dijit/Dialog","dijit/form/Form","dijit/ProgressBar","dijit/form/Select","dijit/Tree",
			    			"dijit/form/Button","dijit/form/RadioButton","dijit/form/CheckBox","dijit/form/ValidationTextBox",
			    			"dojox/data/QueryReadStore","dojox/grid/DataGrid","dojox/layout/ContentPane","dojox/widget/DialogSimple","dijit/layout/SplitContainer",
			    			"dojo/data/ItemFileWriteStore","dojox/grid/EnhancedGrid","dojox/grid/enhanced/plugins/IndirectSelection","dijit/layout/StackContainer"
				         ],function(ready,parser,i18n,module){
				     DataDictValue = {
				    		 _module:module,
				    		 _resourse:i18n,
				    		 refresh:function(){
				    			 window.location.reload();
				    		 },
				    		 remove:function(did){
				    			 var options={
											domain:DataDictValue._resourse.dataDictValue,
											refresh:DataDictValue.refresh,
											url:"../../dd/ddvalue/"+did,
											button:dijit.byId("btn_ddvalue_del"),
											dialogId:"delValueDlg",
											resource:DataDictValue._resourse
									};
									KppModule.restProxy(options).remove();
				    		 },
				    		 test:function(){
				    			 var xhrArgs = {
				 	    			    url: "../../dd/ddValue/list.json",
				 	    			    handleAs: "text",
				 	    			    load: function(data){
				 	    			    	eval("data="+data);
				 	    			    	var store = new dojo.store.Memory({
										        data: data,
										        getChildren: function(object){
										            return this.query({parent: object.id});
										        }
    										});
				 	    			    	myModel = new dijit.tree.ObjectStoreModel({
				 	    			           store: store,
				 	    			           query: {id: 'root'}
				 	    			       });
				 	    			    	
				 	    			    	menuTree = new dijit.Tree({
				 	    			    		model : myModel,
				 	    			    		showRoot: true,
				 	    			    		openOnClick: true
				 	    			    	}, 'menuTree');
				 	    			    	menuTree.startup();
				 	    			    	
				 	    			    	var pMenu;
				 	    			        pMenu = new dijit.Menu({
				 	    			            targetNodeIds: ["menuTree"],
				 	    			           	selector: ".dijitTreeNode",
				 	    			           	style:"display: none;"
				 	    			        });
				 	    			        pMenu.addChild(new dijit.MenuItem({
				 	    			            label: "Simple menu item"
				 	    			        }));
				 	    			        pMenu.addChild(new dijit.MenuItem({
				 	    			            label: "Disabled menu item",
				 	    			            disabled: true
				 	    			        }));
				 	    			        pMenu.addChild(new dijit.MenuItem({
				 	    			            label: "Menu Item With an icon",
				 	    			            iconClass: "dijitEditorIcon dijitEditorIconCut",
				 	    			            onClick: function(){alert('i was clicked')}
				 	    			        }));
				 	    			    },
				 	    			    error: function(error){
				 	    			    	alert(3);
				 	    			    }
				 	    			  };

				 	    			  // Call the asynchronous xhrGet
				 	    			  var deferred = dojo.xhrGet(xhrArgs);
				    		 }
				     };
				     
				    document.getElementById("dd_value_add").innerHTML = $ksub(module.commonResource.operCreate,[i18n.dataDictValue])+"<script type=\"dojo/connect\" data-dojo-event=\"onClick\">"+
						"	var tn = dijit.byNode(this.getParent().currentTarget);var dvId=tn.item.id;$ku.showDialog({id:\"dialog_config_datadictvalue_new\","+
						"url:\"../../dd/ddvalue/\"+dvId+\"/new.html\?typeId=${typeId}\",title:$ksub(DataDictValue._module.commonResource.operCreate,[DataDictValue._resourse.dataDictValue]),resource:DataDictValue._resourse,style:\"width:300px;height:190px;\"});<\/script>";
	                   			 
					document.getElementById("dd_value_edit").innerHTML = $ksub(module.commonResource.operEdit,[i18n.dataDictValue])+"<script type=\"dojo/connect\" data-dojo-event=\"onClick\">"+
					"var tn = dijit.byNode(this.getParent().currentTarget);"+
					"var dvId=tn.item.id;if(dvId!=\"root\"){$ku.showDialog({id:\"dialog_config_datadictvalue_edit\",url:\"../../dd/ddvalue/edit/\"+dvId+\".html\","+
					"title:$ksub(DataDictValue._module.commonResource.operEdit,[DataDictValue._resourse.dataDictValue]),"+
					"resource:DataDictValue._resourse,style:\"width:300px;height:190px;\"});}<\/script>";
					
					var temp='"<div style=\\"padding:20px;text-align:center\\">"+DataDictValue._module.commonResource.removeValueConfig+"</div>" +'+
					'"<div style=\\"text-align:center\\"><div data-dojo-type=\\"dijit.form.Button\\" data-dojo-props=\\"iconClass:\'dijitEditorIcon dijitEditorIconDelete\', id:\'btn_ddvalue_del\',showLabel:true, busyLabel:\'"+DataDictValue._module.commonResource.removing+"\'\\">"+DataDictValue._module.commonResource.remove+'+
					'"<script type=\\"dojo/method\\" event=\\"onClick\\" args=\\"evt\\">DataDictValue.remove(\'"+dvId+"\',this)<\\/script>"+'+
					'"</div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+'+
					'"<div data-dojo-type=\\"dijit.form.Button\\" data-dojo-props=\\"iconClass:\'dijitEditorIcon dijitEditorIconCancel\', showLabel:true\\">"+DataDictValue._module.commonResource.cancel +'+
					'"<script type=\'dojo/method\' event=\'onClick\' args=\'evt\'>dijit.byId(\'delValueDlg\').hide();<\\/script></div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+'+
					'"</div>"';
					
					document.getElementById("dd_value_remove").innerHTML = $ksub(module.commonResource.operDelete,[i18n.dataDictValue])+"<script type=\"dojo/connect\" data-dojo-event=\"onClick\">"+
                	"var tn = dijit.byNode(this.getParent().currentTarget);var dvId=tn.item.id;if(dvId!=\"root\"){this.dlg=dijit.byId(\"delValueDlg\");if(!this.dlg)this.dlg=new dijit.Dialog({"+
					"id:\"delValueDlg\",title: DataDictValue._module.commonResource.confirm,style: \"padding:0px;width:300px;height:200px;background-color:#FFF;\"});"+
					"this.dlg.set(\"content\","+temp+");this.dlg.show();}<\/script>";
				});
			</script>
			
			<div onclick="DataDictValue.test()">xxxx</div>
			
			<div data-dojo-type="dijit/Tree" id="menuTree"></div>
			

		    
	</body>
</html>

